import api from "api";


export const dashboard = ({ }, params) => {
  return api.get(`/dashboard`, params);
}

export const addUser = ({ }, params) => {
  return api.post(`/user/add`, params);
}
export const login = ({ }, params) => {
  return api.post(`/user/login`, params);
}
export const logout = ({ }, userId) => {
  return api.get(`/user/logout?user_id=${userId}`);
}
export const getUserlist = ({ }, params) => {
  return api.post(`/user/list`, params);
}
export const getUserDetail = ({ }, userId) => {
  return api.get(`/user/detail?user_id=${userId}`);
}
export const updateUser = ({ }, params) => {
  return api.post(`/user/update`, params);
}
export const deleteUser = ({ }, userId) => {
  return api.delete(`/user/delete?user_id=${userId}`);
}



export const addArticle = ({ }, params) => {
  return api.post(`/article/add`, params);
}
export const getArticlelist = ({ }, params) => {
  return api.post(`/article/list`, params);
}
export const getArticleDetail = ({ }, articleId) => {
  return api.get(`/article/detail?article_id=${articleId}`);
}
export const articlePublish = ({ }, articleId) => {
  return api.get(`/article/publish?article_id=${articleId}`);
}
export const articleShield = ({ }, articleId) => {
  return api.get(`/article/shield?article_id=${articleId}`);
}
export const updateArticle = ({ }, params) => {
  return api.post(`/article/update`, params);
}
export const searchArticle = ({ }, keyword) => {
  return api.get(`/article/search?keyword=${keyword}`);
}

export const deleteArticle = ({ }, articleId) => {
  return api.delete(`/article/delete?article_id=${articleId}`);
}





export const singleUpload = ({ }, formData) => {
  return api.post(`/upload/singleUpload`, formData);
}


export const addTag = ({ }, params) => {
  return api.post(`/tag/add`, params);
}
export const getTaglist = ({ }, params) => {
  return api.post(`/tag/list`, params);
}
export const updateTag = ({ }, params) => {
  return api.post(`/tag/update`, params);
}
export const deleteTag = ({ }, tagId) => {
  return api.delete(`/tag/delete?tag_id=${tagId}`);
}



export const addComment = ({ }, params) => {
  return api.post(`/comment/add`, params);
}
export const commentPublish = ({ }, commentId) => {
  return api.get(`/comment/publish?comment_id=${commentId}`);
}
export const commentShield = ({ }, commentId) => {
  return api.get(`/comment/shield?comment_id=${commentId}`);
}
export const getCommentlist = ({ }, params) => {
  return api.post(`/comment/list`, params);
}
export const deleteComment = ({ }, commentId) => {
  return api.delete(`/comment/delete?comment_id=${commentId}`);
}
